#include <bits/stdc++.h>
using namespace std;
int v, n, p;
int f[10010];
int main()
{
	cin >> v >> n;
	f[0] = 1;
	for(int i = 1; i <= v; i++)
	{
		cin >> p;
		for(int j = p; j <= n; j++)
			f[j] += f[j-p];
	}
	cout << f[n];
	return 0;
}